% Advanced pack usage - ver 2
% Example from TclTk documentation

functor
import
   Tk 
define
   W = {New Tk.toplevel tkInit(title:"Advanced pack demo" background:white)}

   {Tk.send wm(title W "Another way to set up title")}

   F = {New Tk.font tkInit(family:tahoma size:10)}

   T = {New Tk.label tkInit(parent:W 
                            text:"This widget is at the top" 
                            bg:red)}


   L = {New Tk.label tkInit(parent:W 
                            text:"Left\nHand\nSide")}

   B = {New Tk.label tkInit(parent:W 
                            text:"This widget is at the bottom" 
                            bg:green)}

   R = {New Tk.label tkInit(parent:W
                            text:"Right\nHand\nSide")}

   M = {New Tk.text tkInit(parent:W)}
   {M tk(insert 'end' "This layout is like Java's BorderLayout")}

   {T tk(configure font:F)}

   {ForAll [T B L R M] proc{$ O} {O tk(configure font:F)} end}

   {Tk.send pack(T side:top fill:x)}
   {Tk.send pack(B side:bottom fill:x)}
   {Tk.send pack(L side:left fill:y)}
   {Tk.send pack(R side:right fill:y)}
   {Tk.send pack(M expand:true fill:both)}

end
